package org.uengine.codi.mw3.wih;

import java.io.Serializable;
import java.util.Date;

import org.metaworks.ContextAware;
import org.metaworks.MetaworksContext;
import org.metaworks.annotation.Face;
import org.metaworks.annotation.Hidden;
import org.uengine.codi.ITool;

public class ApproveVacationRequest implements ContextAware,ITool, Serializable {

	
	private boolean continueYn;
	private String rejectReason;
	private String applicantBoss;
	
	private Date requestDate;
	private String Applicant;
	private Date vacationStartingDate;
	private Date vacationEndingDate;
	private String numberOfOfficeDaysRequested;
	
	String instanceId;
	@Hidden
		public String getInstanceId() {
			return instanceId;
		}
		public void setInstanceId(String instanceId) {
			this.instanceId = instanceId;
		}
		
		@Face(displayName="$REGISTERVACATIONREQUEST_REQUEST_DATE")
	public Date getRequestDate() {
			return requestDate;
		}
		public void setRequestDate(Date requestDate) {
			this.requestDate = requestDate;
		}
		
		@Face(displayName="$REGISTERVACATIONREQUEST_APPLICANT")
		public String getApplicant() {
			return Applicant;
		}
		public void setApplicant(String applicant) {
			Applicant = applicant;
		}
		
		@Face(displayName="$REGISTERVACATIONREQUEST_VACATION_STARTING_DATE")
		public Date getVacationStartingDate() {
			return vacationStartingDate;
		}
		public void setVacationStartingDate(Date vacationStartingDate) {
			this.vacationStartingDate = vacationStartingDate;
		}
		
		@Face(displayName="$REGISTERVACATIONREQUEST_VACATION_END_DATE")
		public Date getVacationEndingDate() {
			return vacationEndingDate;
		}
		public void setVacationEndingDate(Date vacationEndingDate) {
			this.vacationEndingDate = vacationEndingDate;
		}
		
		@Face(displayName="$REGISTERVACATIONREQUEST_NUMBEROFOFFICEDAYSREQIESTED")
		public String getNumberOfOfficeDaysRequested() {
			return numberOfOfficeDaysRequested;
		}
		public void setNumberOfOfficeDaysRequested(String numberOfOfficeDaysRequested) {
			this.numberOfOfficeDaysRequested = numberOfOfficeDaysRequested;
		}
	
		@Face(displayName="$APPROVEVACATIONREQUEST_APPROVED")
	public boolean isContinueYn() {
		return continueYn;
	}

	public void setContinueYn(boolean continueYn) {
		this.continueYn = continueYn;
	}

	@Face(displayName="$APPROVEVACATIONREQUEST_REJECT_REASON")
	public String getRejectReason() {
		return rejectReason;
	}

	public void setRejectReason(String rejectReason) {
		this.rejectReason = rejectReason;
	}

	@Face(displayName="$APPROVEVACATIONREQUEST_APPLICANT_BOSS")
	public String getApplicantBoss() {
		return applicantBoss;
	}

	public void setApplicantBoss(String applicantBoss) {
		this.applicantBoss = applicantBoss;
	}
	
	MetaworksContext metaworksContext;
	public MetaworksContext getMetaworksContext() {
		return metaworksContext;
	}
	public void setMetaworksContext(MetaworksContext metaworksContext) {
		this.metaworksContext = metaworksContext;
	}
	
	public ApproveVacationRequest() {
		setMetaworksContext(new MetaworksContext());
		getMetaworksContext().setWhen(MetaworksContext.WHEN_EDIT);
		
		requestDate = new Date();
		vacationStartingDate = new Date();
		vacationEndingDate = new Date();
	}

	String approveYnVar;
	@Hidden
	public String getApproveYnVar() {
		return approveYnVar;
	}

	public void setApproveYnVar(String approveYnVar) {
		this.approveYnVar = approveYnVar;
	}

	@Override
	public void onLoad() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void beforeComplete() {
		// TODO Auto-generated method stub
		this.approveYnVar = (this.continueYn == true ? "Y" : "N"); 
	}

	@Override
	public void afterComplete() {
		// TODO Auto-generated method stub

	}

}
